package display
{
	import flash.display.Graphics;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.filters.GlowFilter;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	import org.musince.util.TextFieldUtil;
	
	public class TalkPanel extends Sprite
	{
		public var contentTF:TextField;
		public var nameTF:TextField;
		
		private var _bg:Shape; 
		
		public function TalkPanel()
		{
			super();
			initBG();
			initTFs();
			addChild(_bg);
			addChild(contentTF);
			addChild(nameTF);
		}
		
		private function initTFs():void {
			nameTF = TextFieldUtil.getTextField(40);
			nameTF.x = 30;
			nameTF.y = 6;
			nameTF.filters = [new GlowFilter(0x6F8EC7, 1, 5, 5, 5)];
//			nameTF.text = "小红帽：";			
			
			contentTF = TextFieldUtil.getTextField(34);
			var tft:TextFormat = contentTF.defaultTextFormat;
			tft.align = TextFormatAlign.LEFT;
			tft.leading = 10;
			contentTF.defaultTextFormat = tft;
			contentTF.x = 30;
			contentTF.y = 60;
			contentTF.autoSize = TextFieldAutoSize.NONE;
			contentTF.width = 820;
			contentTF.height = 114;
			contentTF.multiline = true;
//			contentTF.wordWrap = true;
			contentTF.filters = [new GlowFilter(0x696281, 1, 4, 4, 5)];
//			contentTF.text = "亲二的 你真想好了吗？\n真心想好了吗？";			
		}
		
		private function initBG():void {
			_bg = new Shape;
			var g:Graphics = _bg.graphics;
			g.beginFill(0x8BA2CC, 0.6);
			g.drawRoundRect(0, 0, 1000, 178, 20, 20);
			g.endFill();
		}
		
		public function clear():void {
			nameTF.text = "";
			contentTF.text = "";
		}
		
		public function setContent():void {
			
		}
		
		public function setTalker():void {
			
		}
		
		

	}
}